

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>5.2. UCTB.preprocess package &mdash; UCTB  documentation</title>
  

  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
        <link rel="index" title="Index"
              href="genindex.html"/>
        <link rel="search" title="Search" href="search.html"/>
    <link rel="top" title="UCTB  documentation" href="index.html"/>
        <link rel="up" title="5. API Reference" href="APIReference.html"/>
        <link rel="next" title="5.3. UCTB.model_unit package" href="UCTB.model_unit.html"/>
        <link rel="prev" title="5.1. UCTB.dataset package" href="UCTB.dataset.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> UCTB
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
                <ul>
<li class="toctree-l1"><a class="reference internal" href="md_file/introduction.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="md_file/installation.html">2. Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="md_file/quickstart.html">3. Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="md_file/tutorial.html">4. Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="APIReference.html">5. API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="md_file/all_results.html">6. Results on different datasets</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">UCTB</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          













<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    
      <li><a href="index.html">Docs</a> &raquo;</li>
        
          <li><a href="APIReference.html">5. API Reference</a> &raquo;</li>
        
      <li>5.2. UCTB.preprocess package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/UCTB.preprocess.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="uctb-preprocess-package">
<h1>5.2. UCTB.preprocess package<a class="headerlink" href="#uctb-preprocess-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="uctb-preprocess-graphgenerator-module">
<h2>5.2.1. UCTB.preprocess.GraphGenerator module<a class="headerlink" href="#uctb-preprocess-graphgenerator-module" title="Permalink to this headline">¶</a></h2>
<span class="target" id="module-UCTB.preprocess.GraphGenerator"></span><dl class="class">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator">
<em class="property">class </em><code class="sig-prename descclassname">UCTB.preprocess.GraphGenerator.</code><code class="sig-name descname">GraphGenerator</code><span class="sig-paren">(</span><em class="sig-param">data_loader</em>, <em class="sig-param">graph='Correlation'</em>, <em class="sig-param">threshold_distance=1000</em>, <em class="sig-param">threshold_correlation=0</em>, <em class="sig-param">threshold_interaction=500</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>This class is used to build graphs.
Adajacent matrix and lapalace matrix will be stored in self.AM and self.LM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data_loader</strong> (<a class="reference internal" href="UCTB.dataset.html#UCTB.dataset.data_loader.NodeTrafficLoader" title="UCTB.dataset.data_loader.NodeTrafficLoader"><em>NodeTrafficLoader</em></a>) – data_loader object.</p></li>
<li><p><strong>graph</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Types of graphs used in neural methods. Graphs should be a subset of { <code class="docutils literal notranslate"><span class="pre">'Correlation'</span></code>,
<code class="docutils literal notranslate"><span class="pre">'Distance'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Interaction'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Line'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Neighbor'</span></code>, <code class="docutils literal notranslate"><span class="pre">'Transfer'</span></code> } and concatenated by <code class="docutils literal notranslate"><span class="pre">'-'</span></code>,
and <em>dataset</em> should have data of selected graphs. Default: <code class="docutils literal notranslate"><span class="pre">'Correlation'</span></code></p></li>
<li><p><strong>threshold_distance</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Used in building of distance graph. If distance of two nodes in meters is larger
than <code class="docutils literal notranslate"><span class="pre">threshold_distance</span></code>, the corresponding position of the distance graph will be 1 and otherwise
0.the corresponding Default: 1000</p></li>
<li><p><strong>threshold_correlation</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Used in building of correlation graph. If the Pearson correlation coefficient is
larger than <code class="docutils literal notranslate"><span class="pre">threshold_correlation</span></code>, the corresponding position of the correlation graph will be 1
and otherwise 0. Default: 0</p></li>
<li><p><strong>threshold_interaction</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Used in building of interatction graph. If in the latest 12 months, the number of
times of interaction between two nodes is larger than <code class="docutils literal notranslate"><span class="pre">threshold_interaction</span></code>, the corresponding position
of the interaction graph will be 1 and otherwise 0. Default: 500</p></li>
</ul>
</dd>
</dl>
<dl class="attribute">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.AM">
<code class="sig-name descname">AM</code><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.AM" title="Permalink to this definition">¶</a></dt>
<dd><p>Adajacent matrices of graphs.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="attribute">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.LM">
<code class="sig-name descname">LM</code><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.LM" title="Permalink to this definition">¶</a></dt>
<dd><p>Laplacian matrices of graphs.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>array</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.adjacent_to_laplacian">
<em class="property">static </em><code class="sig-name descname">adjacent_to_laplacian</code><span class="sig-paren">(</span><em class="sig-param">adjacent_matrix</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.adjacent_to_laplacian" title="Permalink to this definition">¶</a></dt>
<dd><p>Turn adjacent_matrix into Laplace matrix.</p>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.correlation_adjacent">
<em class="property">static </em><code class="sig-name descname">correlation_adjacent</code><span class="sig-paren">(</span><em class="sig-param">traffic_data</em>, <em class="sig-param">threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.correlation_adjacent" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate correlation graph based on pearson coefficient.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>traffic_data</strong> (<em>ndarray</em>) – numpy array with shape [sequence_length, num_node].</p></li>
<li><p><strong>threshold</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – float between [-1, 1], nodes with Pearson Correlation coefficient
larger than this threshold will be linked together.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.distance_adjacent">
<code class="sig-name descname">distance_adjacent</code><span class="sig-paren">(</span><em class="sig-param">lat_lng_list</em>, <em class="sig-param">threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.distance_adjacent" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate distance graph based on geographic distance.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lat_lng_list</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a>) – A list of geographic locations. The format of each element
in the list is [latitude, longitude].</p></li>
<li><p><strong>threshold</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – (meters) nodes with geographic distacne smaller than this
threshold will be linked together.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.haversine">
<em class="property">static </em><code class="sig-name descname">haversine</code><span class="sig-paren">(</span><em class="sig-param">lat1</em>, <em class="sig-param">lon1</em>, <em class="sig-param">lat2</em>, <em class="sig-param">lon2</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.haversine" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the great circle distance between two points
on the earth (specified in decimal degrees)</p>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.GraphGenerator.GraphGenerator.interaction_adjacent">
<em class="property">static </em><code class="sig-name descname">interaction_adjacent</code><span class="sig-paren">(</span><em class="sig-param">interaction_matrix</em>, <em class="sig-param">threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.GraphGenerator.GraphGenerator.interaction_adjacent" title="Permalink to this definition">¶</a></dt>
<dd><p>Binarize interaction_matrix based on threshold.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>interaction_matrix</strong> (<em>ndarray</em>) – <p>with shape [num_node, num_node], where each
element represents the number of interactions during a certain time,</p>
<blockquote>
<div><p>e.g. 6 monthes, between the corresponding nodes.</p>
</div></blockquote>
</p></li>
<li><p><strong>threshold</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – nodes with number of interactions between them
greater than this threshold will be linked together.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-UCTB.preprocess.preprocessor">
<span id="uctb-preprocess-preprocessor-module"></span><h2>5.2.2. UCTB.preprocess.preprocessor module<a class="headerlink" href="#module-UCTB.preprocess.preprocessor" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="UCTB.preprocess.preprocessor.Normalizer">
<em class="property">class </em><code class="sig-prename descclassname">UCTB.preprocess.preprocessor.</code><code class="sig-name descname">Normalizer</code><span class="sig-paren">(</span><em class="sig-param">X</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.Normalizer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>This class can help normalize and denormalize data by calling min_max_normal and min_max_denormal method.</p>
<dl class="method">
<dt id="UCTB.preprocess.preprocessor.Normalizer.min_max_denormal">
<code class="sig-name descname">min_max_denormal</code><span class="sig-paren">(</span><em class="sig-param">X</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.Normalizer.min_max_denormal" title="Permalink to this definition">¶</a></dt>
<dd><p>Input X, return denormalized results.
:type: numpy.ndarray</p>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.preprocessor.Normalizer.min_max_normal">
<code class="sig-name descname">min_max_normal</code><span class="sig-paren">(</span><em class="sig-param">X</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.Normalizer.min_max_normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Input X, return normalized results.
:type: numpy.ndarray</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="UCTB.preprocess.preprocessor.ST_MoveSample">
<em class="property">class </em><code class="sig-prename descclassname">UCTB.preprocess.preprocessor.</code><code class="sig-name descname">ST_MoveSample</code><span class="sig-paren">(</span><em class="sig-param">closeness_len</em>, <em class="sig-param">period_len</em>, <em class="sig-param">trend_len</em>, <em class="sig-param">target_length=1</em>, <em class="sig-param">daily_slots=24</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.ST_MoveSample" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>This class can converts raw data into temporal features including closenss, period and trend features.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>closeness_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The length of closeness data history. The former consecutive <code class="docutils literal notranslate"><span class="pre">closeness_len</span></code> time slots
of data will be used as closeness history.</p></li>
<li><p><strong>period_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The length of period data history. The data of exact same time slots in former consecutive
<code class="docutils literal notranslate"><span class="pre">period_len</span></code> days will be used as period history.</p></li>
<li><p><strong>trend_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The length of trend data history. The data of exact same time slots in former consecutive
<code class="docutils literal notranslate"><span class="pre">trend_len</span></code> weeks (every seven days) will be used as trend history.</p></li>
<li><p><strong>target_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The numbers of steps that need prediction by one piece of history data. Have to be 1 now.
Default: 1 default:1.</p></li>
<li><p><strong>daily_slots</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of records of one day. Calculated by 24 * 60 /time_fitness. default:24.</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="UCTB.preprocess.preprocessor.ST_MoveSample.move_sample">
<code class="sig-name descname">move_sample</code><span class="sig-paren">(</span><em class="sig-param">data</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.ST_MoveSample.move_sample" title="Permalink to this definition">¶</a></dt>
<dd><p>Input data to generate closeness, period, trend features and target vector y.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<em>ndarray</em>) – Orginal temporal data.</p>
</dd>
</dl>
<p>:return:closeness, period, trend and y matrices.
:type: numpy.ndarray.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="UCTB.preprocess.preprocessor.SplitData">
<em class="property">class </em><code class="sig-prename descclassname">UCTB.preprocess.preprocessor.</code><code class="sig-name descname">SplitData</code><a class="headerlink" href="#UCTB.preprocess.preprocessor.SplitData" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>This class can help split data by calling split_data and split_feed_dict method.</p>
<dl class="method">
<dt id="UCTB.preprocess.preprocessor.SplitData.split_data">
<em class="property">static </em><code class="sig-name descname">split_data</code><span class="sig-paren">(</span><em class="sig-param">data</em>, <em class="sig-param">ratio_list</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.SplitData.split_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Divide the data based on the given parameter ratio_list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<em>ndarray</em>) – Data to be split.</p></li>
<li><p><strong>ratio_list</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a>) – Split ratio, the <cite>data</cite> will be split according to the ratio.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>:return:The elements in the returned list are the divided data, and the</dt><dd><p>dimensions of the list are the same as ratio_list.</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)">list</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="UCTB.preprocess.preprocessor.SplitData.split_feed_dict">
<em class="property">static </em><code class="sig-name descname">split_feed_dict</code><span class="sig-paren">(</span><em class="sig-param">feed_dict</em>, <em class="sig-param">sequence_length</em>, <em class="sig-param">ratio_list</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.preprocessor.SplitData.split_feed_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Divide the <cite>value</cite> data in <cite>feed_dict</cite> based on the given parameter ratio_list.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>feed_dict</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)"><em>dict</em></a>) – It is a dictionary composed of <cite>key-value</cite> pairs.</p></li>
<li><p><strong>sequence_length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – If the length of <cite>value</cite> in <cite>feed_dict</cite> is equal to sequence_length,
then this method divides the <cite>value</cite> according to the ratio without changing its <cite>key</cite>.</p></li>
<li><p><strong>ratio_list</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a>) – Split ratio, the data will be split according to the ratio.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The elements in the returned list are divided dictionaries, and the dimensions of the list are the same as ratio_list.</p>
</dd>
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)">list</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-UCTB.preprocess.time_utils">
<span id="uctb-preprocess-time-utils-module"></span><h2>5.2.3. UCTB.preprocess.time_utils module<a class="headerlink" href="#module-UCTB.preprocess.time_utils" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="UCTB.preprocess.time_utils.is_valid_date">
<code class="sig-prename descclassname">UCTB.preprocess.time_utils.</code><code class="sig-name descname">is_valid_date</code><span class="sig-paren">(</span><em class="sig-param">date_str</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.time_utils.is_valid_date" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>date_str</strong> (<em>string</em>) – e.g. 2019-01-01</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if date_str is valid date,
otherwise return False.</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="UCTB.preprocess.time_utils.is_work_day_america">
<code class="sig-prename descclassname">UCTB.preprocess.time_utils.</code><code class="sig-name descname">is_work_day_america</code><span class="sig-paren">(</span><em class="sig-param">date</em>, <em class="sig-param">city</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.time_utils.is_work_day_america" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>date</strong> (<em>string</em><em> or </em><em>datetime</em>) – e.g. 2019-01-01</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if date is not holiday in America,
otherwise return False.</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="UCTB.preprocess.time_utils.is_work_day_china">
<code class="sig-prename descclassname">UCTB.preprocess.time_utils.</code><code class="sig-name descname">is_work_day_china</code><span class="sig-paren">(</span><em class="sig-param">date</em>, <em class="sig-param">city</em><span class="sig-paren">)</span><a class="headerlink" href="#UCTB.preprocess.time_utils.is_work_day_china" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>date</strong> (<em>string</em><em> or </em><em>datetime</em>) – e.g. 2019-01-01</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if date is not holiday in China,
otherwise return False.</p>
</dd>
</dl>
</dd></dl>

</div>
</div>


           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="UCTB.model_unit.html" class="btn btn-neutral float-right" title="5.3. UCTB.model_unit package" accesskey="n">Next →</a>
      
      
        <a href="UCTB.dataset.html" class="btn btn-neutral" title="5.1. UCTB.dataset package" accesskey="p">← Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, UCTB group.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE: 'true'
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>
      <script type="text/javascript" src="_static/language_data.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>